/**
 * 属性模块路由文件
 */

const Router = require('koa-router');
const router = new Router();
const { validate } = require('../validators/common');
const { add, update, del, getList } = require('../services/attrs');
const { validAdd, validUpdate } = require('../validators/attrs');
const { authorization } = require('./common');

router.prefix('/attrs');

router.post('/add', authorization('attrsAdd'), validate(validAdd), add);

router.put('/update', authorization('attrsUpdate'), validate(validUpdate), update);

router.get('/list/:class_id', authorization('attrsGet'), getList);

router.delete('/delete/:id', authorization('attrsDelete'), del);

module.exports = router;